import 'package:flutter/material.dart';

class inputField extends StatelessWidget {
  inputField({
    required this.textController,
    required this.iconData,
    required this.onPressed,
  });

  final TextEditingController textController;
  final IconData iconData;
  final void Function() onPressed;

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: 50, vertical: 30),
      decoration: BoxDecoration(
        color: Colors.black.withOpacity(0.3),
        borderRadius: BorderRadius.circular(40.0),
      ),
      child: TextField(
        controller: textController,
        showCursor: false,
        textAlign: TextAlign.center,
        cursorColor: Colors.black,
        style: TextStyle(
          color: Colors.white,
          fontSize: 22,
        ),
        decoration: InputDecoration(
          suffixIcon: GestureDetector(
            onTap: () {
              textController.clear();
            },
            child: Icon(
              iconData,
              size: 50,
              color: Colors.white,
            ),
          ),
          border: InputBorder.none,
        ),
      ),
    );
  }
}